<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //订单信息表
        Schema::create('orders', function(Blueprint $table) {
            $table->increments('id')->comment('自增id');
            $table->integer('good_id')->default(0)->comment('商品id');
            $table->integer('user_id')->default(0)->comment('用户id');
            $table->string('order_num')->nullable()->comment('订单编号');
            $table->integer('picture_id')->default(0)->comment('图片id');
            $table->integer('num')->default(0)->comment('数量');
            $table->string('attr_name')->nullable()->comment('属性');
            $table->decimal('amount')->default(0)->comment('金额');
            $table->integer('coin')->default(0)->comment('波罗币');
            $table->integer('is_pay')->default(0)->comment('是否支付');
            $table->timestamp('pay_time')->nullable()->comment('支付时间');
            $table->string('pay_type')->nullable()->comment('支付方式');
            $table->string('realname')->nullable()->comment('真实姓名');
            $table->string('phone')->nullable()->comment('联系方式');
            $table->string('qq')->nullable()->comment('qq');
            $table->string('wechat')->nullable()->comment('微信');
            $table->string('address')->nullable()->comment('收货地址');
            $table->integer('is_delivery')->default(0)->comment('是否发货');
            $table->integer('status')->default(0)->comment('状态');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
